
The following describes the data files, code and programs used to evaluate North Carolina's voter history files and changes to early in person voting between the 2012 and 2016 elections in the mansucript, "Early voting changes and voter turnout:
North Carolina in the 2016 General Election."

######################################################################
Analysis presented in the body of the manuscript, and associated files:
######################################################################

I) Figure 1-2 

Required files:

1. borders.R
2. CountyBoundary.shp, and associated files
(files can also be found here: https://connect.ncdot.gov/resources/gis/pages/gis-data-layers.aspx)
3. SBE_PRECINCTS_20161004.shp, and associated files
(files can also be found here: https://dl.ncsbe.gov/?prefix=PrecinctMaps/)
4. 2012-2016_Early_Voting_Changes.csv
5. county-maps.R


First, run the script, borders.R. This script will draw on the precinct and county shapefiles, and is used to identify which precincts lie on county borders and saves a data frame with entries that indicates this, written to the file, "border_precincts.csv."

Then run the script, county-maps.R. This script requires the precinct and county shapefiles, the file "border_precincts.csv" just created, and the file "2012-2016_Early_Voting_Changes.csv," which contains information regarding the various changes made to EIP voting rules between 2012 and 2016. This script produces several maps of North Carolina counties, reflecting each type of change. These maps comprise Figure 1 of the manuscript. This script also produces a map identifying precincts that share the county border of Sampson and Duplin counties, displayed in Figure 2 of the manuscript. 

II) Table 1: Top 20 county borders based on percentage changes to EIP voting hours

Required files:

1. CountyBoundary.shp, and associated files
(Files can also be found here: https://connect.ncdot.gov/resources/gis/pages/gis-data-layers.aspx)
2. 2012-2016_Early_Voting_Changes.csv
3. identify-county-differences.R

Run the script, identify-county-differences.R. This script produces the file "county-early-voting-differences.csv," used in the analysis to evaluate differences in turnout from 2012-2016, given differences in EIP offerings between 2012-2016. This script also produces a series of .tex tables displaying the top 20 county pairings that had the largest differences in changes to EIP offerings. This script produces five .tex tables overall. Only one table is included in the manuscript, Table 1, which reflects the top 20 county pairings with the largest difference in changes to total EIP hours offered from 2012-2016. 

III) Table 2: Methods of voting in the 2012 and 2016 General Elections, by race and party

Required files:

1. history_stats_20121106.txt
2. voter_stats_20121106.txt
3. history_stats_20161108.txt
4. voter_stats_20161108.txt
5. basic-plots.R

Files are quite large, and are compressed. Unzip and run the script, basic-plots.R to recreate Table 2. 

IV) Figure 3 - Figure 7

Required files:

1. analysis.R
2. vbf_output
3. interpret_analysis.R
4. county-early-voting-differences.csv

Figure 3 - Figure 7 display the core analysis presented in the manuscript. In order to recreate these figures, first run the script, analysis.R. This script requires the object "vbf_output." This file reflects includes voter registration and history for 2012 and 2016, inclusive of variables relevant to the analysis, and includes markers of whether or not each voter lives in a border precint and the county border pairing in which they are located. The script, analysis.R produces the file "tests_output.txt," which contains the difference-in-proportions test, conducted for each county pairing, type of EIP change, and voter subgroup of interest to our inquiry. Border pairings are introduced using the, "county-early-voting-differences.csv" file (produced in step II above, using the script, identify-county-differences.R).

After running the script, analysis.R, run the script, interpret_analysis.R, which produces Figure 3 - 7 plots by plotting the test results contained "tests_output.txt." 

#########################################################
Analysis presented in the Appendix, and associated files:
#########################################################

I) Tables 1-10

Required files:

1. precinct_comparability.R
2. tl_2017_37_tract.shp, and associated files, located in the "shapes" folder
(shapefiles can also be found here: https://www.census.gov/cgi-bin/geo/shapefiles/index.php?year=2017&layergroup=Census+Tracts)
3. race_eth.csv
4. ACS_16_5YR_S2301_with_ann.csv
5. ACS_16_5YR_DP05_with_ann.csv
6. ACS_16_5YR_S1501_with_ann.csv
7. CountyBoundary.shp, and associated files
(Files can also be found here: https://connect.ncdot.gov/resources/gis/pages/gis-data-layers.aspx)

Run the precinct_comparability.R file in order to produce Tables 1-10 of the Appendix. 

II) Figure 1 - Figure 10

Required files:

1. analysis_lat&ind.R
2. vbf_output
3. interpret_analysis_lat&ind.R
4. county-early-voting-differences.csv

Figure 1 - Figure 10 display the core analysis presented in the manuscript, but include Latinos and Independents alongside whites, Blacks, Republicans and Democrats. In order to recreate these figures, first run the script, analysis_lat&ind.R. This script requires the object "vbf_output." The script produces the file "tests_output_lat&ind.txt," which contains the difference-in-proportions test, conducted for each county pairing, type of EIP change, and voter subgroup of interest to our inquiry. Border pairings are introduced using the, "county-early-voting-differences.csv" file.

After running the script, analysis_lat&ind.R, run the script, interpret_analysis_lat&ind.R, which produces Figure 1 - 10 by plotting the test results contained "tests_output_lat&ind.txt." 

III) Table 11- Table 16

Required files:

1. tests_output_lat&ind.txt
2. universal_test.R

Produce Tables 11 - 16 by running the script universal_test.R.

IV) Table 17 - Table 28

Required files:

1. regression.R
2. vbf_output
3. counties_who_cut.R

Table 17 - Table 28 are regression analyses included as robustness checks. Run the script regression.R, and the the script counties_who_cut.R to produce the tables. Both use the file vbf_output. 

V) Figure 11 - Figure 20

Required files: 

1. analysis_RAW.R
2. vbf_output
3. interpret_analysis_RAW.R
4. county-early-voting-differences.csv

Figure 11 - Figure 20 display the core analysis presented in the manuscript, but examine raw changes in EIP offerings instead of percent changes. In order to recreate these figures, first run the script, analysis_RAW.R. This script requires the object "vbf_output." The script produces the file "tests_output_RAW.txt," which contains the difference-in-proportions test, conducted for each county pairing, type of EIP change, and voter subgroup of interest to our inquiry. Border pairings are introduced using the, "county-early-voting-differences.csv" file.

After running the script, analysis_RAW.R, run the script, interpret_analysis_RAW.R, which produces Figure 11 - 20 by plotting the test results contained "tests_output_RAW.txt." 







